<?php
use yii\helpers\Html;
use yii\helpers\Url;
use yii\widgets\LinkPager;
?>

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>我的消息</title>
    <!--<meta name="description" content="这是主页">-->
    <meta name="keywords" content="form">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <link rel="stylesheet" href="css/chinaz.css">
    <link rel="stylesheet" href="css/amazeui.swiper.min.css">


    <link rel="stylesheet" href="css/index.css">
    <!--<link rel="stylesheet" href="css/amazeui.slick.min.css">
    -->
    <!--<link rel="icon" type="image/png" href="assets/i/favicon.png">
    -->
    <!--<link rel="apple-touch-icon-precomposed" href="assets/i/app-icon72x72@2x.png">
    -->
    <!--<meta name="apple-mobile-web-app-title" content="Amaze UI" />
    -->
    <link rel="stylesheet" href="assets/css/amazeui.min.css"/>
    <link rel="stylesheet" href="assets/css/layout.css"/>
    <script src="assets/js/jquery.min.js"></script>

    <!--<link rel="stylesheet" href="assets/css/admin.css">--></head>
<body>
            <div style="width: 100%;padding-left: 4%;padding-top: 4px;padding-right: 4%">

                <!--概括component-->
                <div style="width: 100%;height: 40px;background-color: #99d3ef;">
                    <div style="float: left;background-color: #55B6E4;width: 2%;height: 40px"></div>
                    <div style="float: left;padding-top: 4px;margin-left: 10px">
                        <span style="font-size: 20px">我的消息</span>

                    </div>
                    <!-- <button style="float: right;margin-right: 20px;background-color: #3A99DB;border: none;color:white;margin-top: 8px;border-radius: 4px;outline: none;padding:4px 10px 4px 10px">
                        意见反馈
                    </button> -->
                </div>
                <!--over-->

                <!--内容component-->

                <div data-am-widget="tabs"
                     class="am-tabs am-tabs-d2"
                >
                    <ul class="am-tabs-nav am-cf" style="">
                        <li class="am-active" style=""><a href="[data-tab-panel-0]">全部消息</a></li>
                        <li class="" style="margin-left: 2px;"><a href="[data-tab-panel-1]">未读消息
                            <span style="color: red;font-size: 12px">(<?= Html::encode($unreadCount)?>)</span>
                        </a></li>
                        <li style=""></li>
                        <li style=""></li>
                        <li style=""></li>

                        <li style="font-size: 12px;padding-top: 10px !important;">
                            <img src="img/mail2.png" style="width: 20px;margin-top: -4px;margin-right: 2px"
                            onclick="readAll()"><span
                                style="cursor: pointer" onclick="readAll(<?= $_COOKIE['user_id'] ?>)">全部置为已读</span>
                        </li>
                        <li style="font-size: 12px;padding-top: 10px !important;">
                            <img src="img/laji.png" style="width: 20px;margin-top: -4px;margin-right: 2px"
                            onclick="readAll()"><span
                                style="cursor: pointer" onclick="clearAll(<?= $_COOKIE['user_id'] ?>)">清空所有消息</span>
                        </li>
                    </ul>
                    <div class="am-tabs-bd">
                        <div data-tab-panel-0 class="am-tab-panel am-active" style="padding-left: 6%;padding-right: 6%">
                            
                            <?php foreach ($msgList as $project): ?>
                            <div style="font-size:16px;height:60px;border-bottom: 1px solid #DDDDDD;padding-top: 12px">
                                <img src=<?= $project->is_read==0?Html::encode("img//mail.png"):Html::encode("img//mail2.png")  ?> style="width: 22px;margin-right: 10px">
                                    <?= Html::encode($project->content) ?>
                                <span style="float: right;margin-right: 20px;font-size: 14px"><?= Html::encode($project->createdDate) ?></span>
                            </div>
                            <?php endforeach; ?>


                        </div>
                        
                        <div data-tab-panel-1 class="am-tab-panel " style="padding-left: 6%;padding-right: 6%">

                            <?php foreach ($unread as $unreadone): ?>
                            <div style="font-size:16px;height:60px;border-bottom: 1px solid #DDDDDD;padding-top: 12px">
                                <img src=<?= Html::encode("img//mail.png") ?> style="width: 22px;margin-right: 10px">
                                    <?= Html::encode($unreadone->content) ?>
                                <span style="float: right;margin-right: 20px;font-size: 14px"><?= Html::encode($unreadone->createdDate) ?></span>
                            </div>
                            <?php endforeach; ?>
                      
                        </div>

                    </div>
                    <?= LinkPager::widget(['pagination' => $pages]); ?>
                </div>

            </div>

    <style>
    /*pagination li{float:left;margin:20px;list-style: none;}*/
    </style>

    <div style="width: 100%;clear: both"></div>

<div style="width: 100%;clear:both"></div>
</body>
<style type="text/css">
    #mymsg {background-color: #5790AC}
</style>
<script>
    var like = document.getElementById("mymsg");
    like.innerHTML += "<img src='img/san.png' style='height: 40px;margin-top: -6px;float: right'> ";
</script>